An ICC (Integrated Circuit Card or “smart card”) contains a limited amount of persistent memory as compared to desktop or laptop computers. Therefore, when data is deleted from an ICC it is important that the memory space previously used to store deleted data is reused when new data is added to the card. Furthermore, the limited processing power of an ICC together with the requirement to process data optimum use of persistent memory suggests that individual data items be stored in contiguous memory locations.
If the number of bytes in a new data item is less than or equal to the number of contiguous bytes of a deleted data item, then the new data can be written into the contiguous memory locations previously occupied by the deleted data. The situation may arise, however, that the number of bytes in a new data item is greater than the number of contiguous bytes of storage previously occupied by any previously deleted data item but is less than the number of bytes previously occupied by all deleted data items.
In the situation that the deleted items when taken together were not contiguous in memory but were in fact isolated one from another throughout the memory, it is necessary to rearrange the data currently in memory so that the unused memory consists of contiguous memory locations. In this manner the new data item can now be written to memory. There are in the current art memory management algorithms for desktop and laptop computers called garbage collection algorithms that perform the task of reorganizing the data in memory so that space available and unused space is contiguous.
Modern ICCs include more sophisticated operating software than the simple ICCs of the past. This more sophisticated operating software includes the ability of the ICC to interact directly with the cardholder (e.g. GSM/3GGP SIM Toolkit), to load and run applications using an on-card virtual machine (e.g. Java Card, MULTOS) and to engage in network communication (e.g. GPRS and IP/TCP). These more sophisticated software techniques make more intense use of the persistent memory in the ICC, adding new data and deleting old data.
Therefore, it is of use to provide advanced garbage collection methods for ICCs.